import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'moveShow',
        component: () => import('@/views/MoveShow.vue'),
        // show: 是表示是否在菜单中显示 useFrame：表示是否为全屏展示页面，默认为false。
        meta: { title: '移动端首页', icon: '', show: false, useFrame: true }
    },
    {
        path: '/movecategory',
        name: 'movecategory',
        component: () => import('@/views/Categorylist.vue'),
        // show: 是表示是否在菜单中显示 useFrame：表示是否为全屏展示页面，默认为false。
        meta: { title: '移动端类目分类', icon: '', show: false, useFrame: true }
    },
    {
        path: '/movedetails',
        name: 'movedetails',
        component: () => import('@/views/Movedetails.vue'),
        // show: 是表示是否在菜单中显示 useFrame：表示是否为全屏展示页面，默认为false。
        meta: { title: '移动端类目分类', icon: '', show: false, useFrame: true }
    },
    {
        path: "/home",
        name: 'home',
        component: () => import('@/views/Home.vue'),
        meta: { title: '首页', icon: 'House', show: true, useFrame: false }
    },
    {
        path: '/category',
        component: () => import('@/views/category/Index.vue'),
        meta: { title: '分类管理', icon: 'Menu', show: true, useFrame: false },
        children: [
            {
                path: '/category/list',
                name:'category-list',
                component: () => import('@/views/category/List.vue'),
                meta: { title: '分类列表', icon: 'List', show: true}
            },
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import('@/views/category/Add.vue'),
                meta: { title: '分类添加', icon: 'Plus', show: true }
            },
            {
                path: '/category/edit',
                name: 'category-edit',
                component: () => import('@/views/category/Edit.vue'),
                meta: { title: '分类编辑', icon: 'Edit', show: false }
            }
        ]
    },
    {
        path: '/product',
        component: () => import('@/views/product/Index.vue'),
        meta: { title: '商品管理', icon: 'Shop', show: true, useFrame: false },
        children: [
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import('@/views/product/List.vue'),
                meta: { title: '商品列表', icon: 'List', show: true }
            },
            {
                path: '/product/add',
                name: 'product-add',
                component: () => import('@/views/product/Add.vue'),
                meta: { title: '商品添加', icon: 'Plus', show: true }
            },
            {
                path: '/product/edit',
                name: 'product-edit',
                component: () => import('@/views/product/Edit.vue'),
                meta: { title: '商品编辑', icon: 'Edit', show: false }
            }
        ]
    }
]

//创建路由对象
const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router;